<template>
  <div>这是index组件内容
      <h1>这是parent----{{$store.state.count}}</h1>
      <el-button @click="addCount">自增</el-button>
  <child-1 ></child-1>
  <child-2 ></child-2>

        {{$store.state.count}}
        {{$store.state.list}}
        <el-button @click="setList">setList</el-button>
</div>
</template>



<script>
//eslint ---代码规范校验
import Child1 from './child1.vue'
import Child2 from './child2.vue'
export default {
  components: {
    Child1,
    Child2,
  },

  data() {
    return {
     
    };
  },
  methods: {
         addCount(){
             this.$store.commit('addCount')
          
      },
      setList(){
          this.$store.commit('setList','这是从parent接受的值')
      }
  },
};
</script>